import request from '@/utils/httpRequest'

export function fetchList (query) {
  return request({
    url: request.adornUrl('/merchantservices/category/page'),
    method: 'get',
    params: query
  })
}

export function fetchCateTree (data) {
  return request({
    url: request.adornUrl('/merchantservices/category/tree'),
    method: 'post',
    params: data
  })
}

export function addObj (obj) {
  return request({
    url: request.adornUrl('/merchantservices/category'),
    method: 'post',
    data: obj
  })
}

export function getObj (id) {
  return request({
    url: request.adornUrl('/merchantservices/category/' + id),
    method: 'get'
  })
}

export function delObj (id) {
  return request({
    url: request.adornUrl('/merchantservices/category/' + id),
    method: 'delete'
  })
}

export function putObj (obj) {
  return request({
    url: request.adornUrl('/merchantservices/category'),
    method: 'put',
    data: obj
  })
}
